package com.bill99.codecheck.tools;

import java.util.List;
import java.util.Locale;
import java.util.ResourceBundle;

import com.bill99.riaframework.common.dto.SonarSeriousProblemDto;

public class TranslationTool {
	public static List<SonarSeriousProblemDto> transEngForCha(List<SonarSeriousProblemDto> seriousList) {
		ResourceBundle bundle = ResourceBundle.getBundle("properties/zh", Locale.CHINA);
		for(SonarSeriousProblemDto sspd:seriousList){
			if(sspd.getPluginName().equals("pmd")){
				sspd.setRuleKey(bundle.getString("rule.pmd."+sspd.getRuleKey()+".name"));
			}
			if(sspd.getPluginName().equals("checkstyle")){
				sspd.setRuleKey(bundle.getString("rule.checkstyle."+sspd.getRuleKey()+".name"));
			}
			if(sspd.getPluginName().equals("findbugs")){
				sspd.setRuleKey(bundle.getString("rule.findbugs."+sspd.getRuleKey()+".name"));
			}
		}
		return seriousList;
	}
}
